#include "Com.h"
#include<sys/types.h>
#include<sys/ipc.h>
#include<sys/shm.h>
#include<unistd.h>

int main()
{
	key_t k = ftok(PATH,PROJ_ID);
	if( k < 0)
	{
		perror("ftok");
		return 1;
	}
	int shmid = shmget(k,SIZE,IPC_CREAT);
	if(shmid < 0)
	{
		perror("shmget");
		return 2;
	}
	char* shm_st = (char*)shmat(shmid,NULL,0);
	char c = 'A';
	while(c <= 'Z')
	{
		shm_st[c-'A'] = c;
		c++;
		sleep(1);
	}
	shmdt(shm_st);
	return 0;
}

